<div>
<h1>文件操作</h1>
<pre>
<span id=":w">:w</span>                  <span>保存文件</span>
<span id=":w &lt;filename&gt;">:w &lt;filename&gt;</span>       <span>按名称保存文件</span>
<span id=":e &lt;filename&gt;">:e &lt;filename&gt;</span>       <span>打开文件并编辑</span>
<span id=":saveas &lt;filename&gt;">:saveas &lt;filename&gt;</span>  <span>另存为文件</span>
<span id=":r &lt;filename&gt;">:r &lt;filename&gt;</span>       <span>读取文件并将内容插入到光标后</span>
<span id=":r !dir">:r !dir</span>             <span>将 dir 命令的输出捕获并插入到光标后</span>
<span id=":close">:close</span>              <span>关闭文件</span>
<span id=":q">:q</span>                  <span>退出</span>
<span id=":q!">:q!</span>                 <span>强制退出</span>
<span id=":wa">:wa</span>                 <span>保存所有文件</span>
<span id=":cd &lt;path&gt;">:cd &lt;path&gt;</span>          <span>切换 Vim 当前路径</span>
<span id=":pwd">:pwd</span>                <span>显示 Vim 当前路径</span>
<span id=":new">:new</span>                <span>打开一个新的窗口编辑新文件</span>
<span id=":enew">:enew</span>               <span>在当前窗口创建新文件</span>
<span id=":vnew">:vnew</span>               <span>在左右切分的新窗口中编辑新文件</span>
<span id=":tabnew">:tabnew</span>             <span>在新的标签页中编辑新文件</span>
</pre>
</div>